#include <iostream>
#include <cstring>
#include <vector>

using namespace std;

int main()
{
    const char *str[] = {"flower", "flow", "flight"};
    int size = sizeof(str) / sizeof(str[0]);

    int lenmin = 0;

    for (int i = 0; i < size - 1; i++)
    {
        if (strlen(str[i]) >= strlen(str[i + 1]))
            lenmin = i + 1;
    }

    // cout << lenmin;
    vector<char> pb;
    for (int i = 0; i < strlen(str[lenmin]); i++)
    {
        int judge = 0;

        for (int m = 0; m < size; m++)
        {
            if (m != lenmin)
            {
                for (int n = 0; n < strlen(str[m]); n++)
                {
                    if (str[m][n] == str[lenmin][i])
                    {
                        judge = judge + 1;
                        break;
                    }
                }
            }
        }

        if (judge == size - 1)
            pb.push_back(str[lenmin][i]);
    }

    cout << "公共部分为：";
    for (int i = 0; i < pb.size(); i++)
    {
        cout << pb[i];
    }
}